import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:flutter_app/BaseMaterialWidget.dart';

class OpacityDemo extends BaseMaterialWidget {
  final double opacity = 0.2;

  @override
  Widget buildContent(BuildContext context) {
    return Center(
      child: Opacity(
        opacity: opacity,
        child: Container(
          width: 250,
          height: 250,
          decoration: BoxDecoration(color: Colors.black),
          child: Text(
            '不透明度为$opacity',
            style: TextStyle(color: Colors.white, fontSize: 28),
          ),
        ),
      ),
    );
  }

  @override
  String getTitle() {
    return "透明度处理";
  }
}
